package com.itheima;

import java.util.ArrayList;
import java.util.Iterator;

public class Demo4 {
    public static void main(String[] args) {

        ArrayList<String> list = new ArrayList<>();

        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");

        Iterator<String> it = list.iterator();
        while(it.hasNext()){
            String content = it.next();

            if("b".equals(content)){
               it.remove();
            }
        }
        System.out.println(list);
    }
}
